<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:composition>
        <h:form>
            <p:panel>
                <f:facet name="header">
                    <h:outputText value="#{login.loginUsuario.fkTipoUsuario.designacao}, "/>
                    <h:outputText value="#{login.nomeUtilizador}"/>
                </f:facet>

                <f:facet name="footer">
                    <c:if test="#{login.senhaDefault()}">
                        <h:outputText value="Ainda não trocou a sua senha Default, caso deseja alterar agora "/>
                        <br/>
                    </c:if>
                    <h:outputText value="clique em guardar ou feche a janela para cancelar"/>
                </f:facet>
                <p:messages id="senhaMsg" globalOnly="true"/>

                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle01.senha}" for="senha" />
                    <p:password id="senha" match="senha2" inline="true" validatorMessage="Senha Não Conscide" minLength="5" feedback="true" value="#{login.loginUsuario.senha}" title="#{bundle01.senha}" required="true"  requiredMessage="#{bundle01.obrigatorio}" />
                    <p:message for="senha"/>

                    <h:outputLabel value="#{bundle01.senha2}" for="senha2" />
                    <p:password id="senha2" feedback="false"  minLength="5" title="#{bundle01.senha2}" required="true" value="#{login.loginUsuario.senha}" requiredMessage="#{bundle01.obrigatorio}"/>
                    <p:message for="senha2" />

                    <p:commandButton update="@form" actionListener="#{login.updateLogin()}" icon="ui-icon-disk" value="#{bundle01.salvar}" />
                </h:panelGrid>
            </p:panel>

        </h:form>

    </ui:composition>

</html>